<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="utf-8"/>
    <link rel="shortcut icon" href="/static/bg_img/favicon.ico">
    <link href="/static/1/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/1/css/swiper.min.css" rel="stylesheet">
    <link rel="stylesheet" href="{{ url_for('static', filename='layui/css/layui.css') }}">
    <script src="/static/1/js/jquery-3.4.1.min.js"></script>
    <script src="/static/1/js/swiper-bundle.min.js"></script>
    <script src="/static/1/js/bootstrap.min.js"></script>

    <title>书目详情</title>
</head>
<style>

    .bookborder tr {
        height: 70px
    }

    .bookborder h3 {
        display: inline;
    }

    ::-webkit-scrollbar {
        display: none;
    }

    body {
        background-size: cover;
        background-image: url("/static/bg_img/bkdeta.jpeg");
        background-attachment: fixed;
        background-repeat: no-repeat;
    }
</style>
<script type="text/javascript">
    function joinBuyAjax() {
        $.ajax({
            url: "/addbuy",
            method: "post",
            data:{
              bid: {{ res["book_id"] }},
            },
            success: function (result) {
                if (result == "1") {
                    layer.msg("加入成功", {
                        time: 1000,
                        icon: 1
                    },
                        function () {
                        window.location.href = ""
                    });

                } else
                    alert("fault")
            },
            error: function (e) {
                alert("conn error")
            }
        });
    }

    function shoucangAjax() {
        $.ajax({
            url: "",
            method: "post",
            success: function (result) {
                if (result == "1") {
                    layer.msg("收藏成功", {
                        time: 1000,
                        icon: 1
                    }, function () {
                        window.location.href = ""
                    });
                } else
                    alert("fault")
            },
            error: function (e) {
                alert("conn error")
            }

        });
    }
</script>
<body >

<div class="page-header">

</div>

<div class="container">
    <div class="row">
        <div class="col-sm-3" style="height: 315px;">
            <img src={{ res["img"] }} height="315" width="180" style="opacity: 0.5;"/>
        </div>
        <div class="col-sm-9" style="height: 450px;">

            <table class="bookborder" frame=void border="0" id = "t">
                <tr>
                    <td width=70%><h3 style="color: #3F3F3F"> 书名:&#12288; {{ res["book_name"] }}</h3>
                    </td>
                    <td width=30%><h3 style="color: #3F3F3F">作者:&#12288;{{ res["author"] }}</h3>
                    </td>
                </tr>
                <tr>
                    <td ><h3 style="color: #5bc0de">价格:&#12288;</h3>
                        <h3 style="color:#5bc0de" align="center" name="price"
                            id="price">{{ res["book_price"] }}元/本</h3></h3>
                    </td>
                    <td>
                        <h3 style="color: #5bc0de">库存:&#12288;<h3 style="color: #5bc0de" align="center" name="kucun"
                                                                  id="kucun">{{ res["book_count"] }}本</h3></h3>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" rowspan="2"><h4 style="color: #3F3F3F">简介:<span>;&#12288;<h4>{{ res["book_des"] }}</h4></span>
                    </h4>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<div class="row">
 <div class="col-sm-6" >
     <center>
         <button type="button" class="layui-btn layui-btn-normal layui-btn-lg" onclick="shoucangAjax()">
             <i class="layui-icon">收藏</i></button>
     </center>
     </div>
    <div class="col-sm-6" >
        <center>
            <button type="button" class="layui-btn layui-btn-lg layui-btn-normal" onclick="joinBuyAjax()">
                <i class="layui-icon layui-icon-cart-simple">加入购物车</i></button>
        </center>
    </div>
</div>
<div class="jumbotron" style="background-color:transparent">
    <div class="container">
        <h2 class="img-thumbnail">第一章节试读</h2>
        <!--&lt;!&ndash;					<div class="row">&ndash;&gt;-->
        <!--&lt;!&ndash;						<div class="col-sm-3" style="height: 480px;">&ndash;&gt;-->

        <!--				        <h1 class="img-thumbnail"><font color="#ffc0cb">试读</font></h1>-->
        <!--						</div>-->
        <!--						<div class="" style="height: 480px;">-->
        <div class="panel-body" style="height: 300px; overflow-y:scroll">
            <div style="border: 1px  #000000; width: 100%; margin: 0 auto;">
                {{ res["chap_1"] | safe}}
            </div>
        </div>

    </div>


</div>

</body>

</html>
